package com.coderman.basketball.infrast.gatawayimpl.trade;

import com.coderman.basketball.domain.gataway.trade.TradeRepository;
import com.coderman.basketball.domain.model.trade.bo.TradePlayerApplyBO;
import com.coderman.basketball.domain.model.trade.bo.TradeTeamApplyBO;
import com.coderman.basketball.infrast.dao.dataobject.trade.TradeRecordDO;
import com.coderman.basketball.infrast.dao.mapper.trade.TradeAssetsMapper;
import com.coderman.basketball.infrast.dao.mapper.trade.TradeMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Description:
 * date: 2021/5/20
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
@Service
public class TradeRepositoryImpl implements TradeRepository {

    @Resource
    private TradeAssetsMapper tradeAssetsMapper;

    @Resource
    private TradeMapper tradeMapper;

    @Override
    public String startOneTradeApply(TradeTeamApplyBO tradeTeamApplyBO) {
        //初始化
        if(tradeTeamApplyBO.getId() == null ||tradeTeamApplyBO.getId() <= 0L ){

        }
        //更新
        else {

        }

        return null;
    }

    @Override
    public String tradeFail(String tradeCode) {
        //1.修改交易申请单状态
        return null;
    }

    @Override
    public String tradeSuccess(String tradeCode) {
        return null;
    }

    @Override
    public String applyTrade(TradePlayerApplyBO tradeApplyBO) {
        return null;
    }

    @Override
    public TradeTeamApplyBO getOneTrade(String tradeCode) {
        TradeRecordDO tradeRecordDO = tradeMapper.getByCode(tradeCode);

        return null;
    }

    @Override
    public TradeTeamApplyBO syncTradeApplyStatus(String tradeCode, Integer status) {
        return null;
    }
}
